home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Commo-Support / Disk-Archive / includes-1_4.dms / includes-1_4.adf / doc.zoo / bootstrap.doc < prev    next >
Encoding:
Text File  |  1989-12-16  |  8.4 KB  |  185 lines

  1. Amiga BootStrap
  2.  
  3.     At priority -40 in the system module initialization sequence, after
  4.     most other modules are initialized, appropriate expansion boards
  5.     are configured.  Appropriate boards will match a
  6.     FindConfigDev(, -1, -1) -- these are all boards on the expansion
  7.     library board list.  Furthermore, they will meet all of the
  8.     following conditions:
  9.  
  10.     1.  CDB_CONFIGME set in cd_Flags,
  11.     2.  ERTB_DIAGVALID set in cd_Rom er_Type,
  12.     3.  diagnostic area pointer (in cd_Rom er_Reserved0c) is
  13.         non-zero,
  14.     4.  DAC_CONFIGTIME set in da_Config, and
  15.     5.  at least one valid resident tag within the diagnostic area,
  16.         the first of which is used by InitResident() below.  This
  17.         resident structure was patched to be valid during the rom
  18.         diagnostic routine run when the expansion library first
  19.         initialized the board.
  20.  
  21.     Boards meeting all these conditions are initialized with the
  22.     standard InitResident() mechanism, with a null seglist.  The board
  23.     initialization code can find it's ConfigDev structure with the
  24.     expansion library's GetCurrentBinding() function.  This is an
  25.     appropriate time for drivers to Enqueue() a boot node on the
  26.     expansion library's eb_MountList for use by the strap module below,
  27.     and clear CDB_CONFIGME so a BindDrivers command will not try to
  28.     initialize the board a second time.
  29.  
  30.  
  31.     Next, at priority -60 in the system module initialization sequence,
  32.     the strap module is invoked.  It conceptually merges the existing
  33.     eb_MountList with a prioritized list for system floppies.  The
  34.     floppy list looks like:
  35.  
  36.     pri    drive
  37.     ---    -----
  38.       5    df0:
  39.     -10     df1:
  40.     -20    df2:
  41.     -30    df3:
  42.     
  43.     The resulting prioritized merged list is used in priority order in
  44.     attempts to boot.  An item on the list is given a chance to boot
  45.     via one of three different mechanisms, depending on whether it is a    <<====
  46.     system floppy or exists on the eb_MountList, and if on the        <<====
  47.     eb_MountList, depending on whether it uses boot code provided in    <<====
  48.     the device ConfigDev diagnostic area, or whether it uses boot code    <<====
  49.     read in off the disk.                        <<====
  50.  
  51.     The eb_MountList is modified before each boot attempt, and then
  52.     restored and re-modified for the next attempt if the boot fails:
  53.  
  54.     1.  the node associated with the current boot attempt is
  55.         placed at the head of the eb_MountList.
  56.     2.  nodes marked as unusable under AmigaDOS are removed from    <<====
  57.         the list.  Nodes that are unusable are marked by the    <<====
  58.         longword bn_DeviceNode->dn_Handler having the most        <<====
  59.         significant bit set.                    <<====
  60.  
  61.     The three different boot mechanisms are:
  62.  
  63.     eb_MountList entrys:
  64.     1.  The entry must be valid boot node, i.e. meet all of the
  65.         following conditions:
  66.         a.  ln_Type is NT_BOOTNODE,
  67.         b.  bn_DeviceNode is non-zero,
  68.         c.  ConfigDev pointer (in ln_Name) is non-zero,
  69.         d.  diagnostic area pointer (in cd_Rom er_Reserved0c) is
  70.         non-zero,
  71.         e.  DAC_CONFIGTIME set in da_Config.
  72.     2.  The type of boot is determined by looking at the DosEnvec    <<====
  73.         pointed to by fssm_Environ pointed to by the dn_Startup in    <<====
  74.         the bn_DeviceNode:                        <<====
  75.         a.  if the de_TableSize is less than DE_BOOTBLOCKS,        <<====
  76.         da_BootPoint is used.                    <<====
  77.         b.    if the de_BootBlocks entry is zero, da_BootPoint is    <<====
  78.         used, otherwise                        <<====
  79.         c.  de_BootBlocks contains the number of blocks to read    <<====
  80.         in from the beginning of the partition, checksum, and    <<====
  81.         try to boot from.                    <<====
  82.     
  83.     for da_BootPoint booting:
  84.     3.  The boot routine of valid boot node is invoked as follows:
  85.         a.  The address of the boot routine is calculated from
  86.         da_BootPoint.
  87.         b.  The resulting boot routine is invoked with the
  88.         ConfigDev pointer on the stack in C fashion: i.e.
  89.         (*boot)(configDev);
  90.     4.  Return from the boot routine indicates failure to boot.
  91.     
  92.     for de_BootBlocks booting:                    <<====
  93.     3.  The disk device must contain valid boot blocks:        <<====
  94.         a.  the device and unit from dn_Startup opens successfully,    <<====
  95.         b.  memory is available for the <de_BootBlocks> *        <<====
  96.         <de_SizeBlock> * 4 bytes of boot block code,        <<====
  97.         c.  the device commands CMD_CLEAR, and CMD_READ of the boot    <<====
  98.         blocks execute without error,                <<====
  99.         d.  the boot blocks pass the longword checksum (with carry    <<====
  100.         wraparound), and                    <<====
  101.         e.  memory is available to construct a boot node on the    <<====
  102.         eb_MountList to describe the floppy.            <<====
  103.         If a device error is reported in 1.c., or if memory is not    <<====
  104.         available for 1.b. or 1.e., a recoverable alert is        <<====
  105.         presented before continuing.                <<====
  106.     4.  The boot code in the boot blocks is invoked as follows:    <<====
  107.         a.  The address of the entry point for the boot code is    <<====
  108.         offset BB_ENTRY into the boot blocks in memory.        <<====
  109.         b.  The boot code is invoked with the IO Request used to    <<====
  110.         issue the device commands in 1.c. above in register    <<====
  111.         A1, with the io_Offset pointing to the beginning of    <<====
  112.         the partition (the origin of the boot blocks) and    <<====
  113.         SysBase in A6.                        <<====
  114.     5.  The boot code returns with results in both D0 and A0.    <<====
  115.         a.  Non-zero D0 indicates boot failure.  The recoverable    <<====
  116.         alert AN_BootError is presented before continuing.    <<====
  117.         b.  Zero D0 indicates A0 contains a pointer to the function    <<====
  118.         to complete the boot.  This completion function is    <<====
  119.         chained to with SysBase in A6 after the strap module    <<====
  120.         frees all it's resources.  It is usually the dos    <<====
  121.         library initialization function, from the dos.library    <<====
  122.         resident tag.  Return from this function is identical    <<====
  123.         to return from the strap module itself.            <<====
  124.  
  125.     system floppy entry:
  126.     1.  The floppy drive must contain a valid boot floppy, i.e.
  127.         meet all of the following conditions:
  128.         a.  the trackdisk.device unit associated with the floppy
  129.         drive opens successfully,
  130.         b.  trackdisk.device commands CMD_CLEAR, TD_CHANGENUM, and
  131.         the CMD_READ of the boot blocks (the first two 512 byte
  132.         blocks) execute without error,
  133.         c.  the boot blocks start with the three characters 'DOS'
  134.         and pass the longword checksum (with carry wraparound),
  135.         and
  136.         d.  memory is available to construct a boot node on the
  137.         eb_MountList to describe the floppy.
  138.         If a trackdisk.device error is reported in 1.b., or if
  139.         memory is not available for 1.d., a recoverable alert is
  140.         presented before continuing.
  141.     2.  The boot code in the boot blocks is invoked as follows:
  142.         a.  The address of the entry point for the boot code is
  143.         offset BB_ENTRY into the boot blocks in memory.
  144.         b.  The boot code is invoked with the IO Request used to
  145.         issue the trackdisk commands in 1.b. above in register
  146.         A1, and SysBase in A6.
  147.     3.  The boot code returns with results in both D0 and A0.
  148.         a.  Non-zero D0 indicates boot failure.  The recoverable
  149.         alert AN_BootError is presented before continuing.
  150.         b.  Zero D0 indicates A0 contains a pointer to the function
  151.         to complete the boot.  This completion function is
  152.         chained to with SysBase in A6 after the strap module
  153.         frees all it's resources.  It is usually the dos
  154.         library initialization function, from the dos.library
  155.         resident tag.  Return from this function is identical
  156.         to return from the strap module itself.
  157.  
  158.  
  159.     If all entries fail to boot, the user is prompted to put a bootable
  160.     disk into a drive with the "strap screen".  The system floppy
  161.     drives are polled for new disks, and the eb_MountList is polled for
  162.     a new head node.  When one or the other appears, the "strap screen"
  163.     is removed and the appropriate boot mechanism is applied as
  164.     described above.  The process of prompting and trying continues
  165.     till a successful boot occurs.
  166.  
  167.  
  168. Changes from 1.3
  169. ----------------
  170.     The following modules have changed:
  171.     romboot          -- romboot is no longer an exec library:
  172.                 RomBoot() is no longer public.  A module at
  173.                 priority -40 still exists to do the same
  174.                 diagnostic area configuration.
  175.     strap            -- Strap presents a new strap screen (i.e.
  176.                 changed the hand screen).  Strap can boot
  177.                 from any floppy.  Code is fixed to boot
  178.                 from non-floppy at a priority higher than
  179.                 5.
  180.  
  181.     The following include files have changed:
  182.     libraries/expansionbase.[hi]     -- fields privatized
  183.     libraries/romboot_base.[hi]      -- no longer exists: BootNode
  184.                         now in expansionbase.[hi]
  185.